package com.muchfish.reactor.api;

import reactor.core.publisher.Flux;

public class ReactorTakeWhileExample {
    public static void main(String[] args) {
        Flux<Integer> source = Flux.just(1, 2, 3, 4, 5);

        // 根据条件获取元素，直到条件不满足
        source.takeWhile(value -> value < 4)
                .subscribe(System.out::println);
    }
}
